﻿// ===============================================================================
// RequestData.cs
// EOS Framework
// ===============================================================================
// Copyright (c) EOS Development Group. All rights reserved.
// ===============================================================================

namespace EOS.Framework.Web.Routing
{
    using System.Web;

    /// <summary>
    /// Wrapps the data, we need to resolve
    /// the request.
    /// </summary>
    class RequestData
    {
        /// <summary>
        /// The HTTP handler of the current route.
        /// </summary>
        private IHttpHandler _httpHandler;

        /// <summary>
        /// Gets the HTTP handler of the route,
        /// which we will invoke later.
        /// </summary>
        /// <value>The HTTP handler.</value>
        public IHttpHandler HttpHandler
        {
            get { return _httpHandler; }
        }

        /// <summary>
        /// The original path before of our request.
        /// </summary>
        private string _path;

        /// <summary>
        /// Gets the original path before of 
        /// our request.
        /// </summary>
        /// <value>The original path before of our request.</value>
        public string Path
        {
            get { return _path; }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="RequestData"/> class
        /// with the path and the HTTP handler, we will invoke in our request proces.
        /// </summary>
        /// <param name="httpHandler">Reference to the HTTP handler of the
        /// matching route, which will be invoked in our request process Typically
        /// this is the MvcHandler.</param>
        /// <param name="originalPath">The original path.</param>
        internal RequestData(IHttpHandler httpHandler, string originalPath)
        {
            this._httpHandler = httpHandler;
            this._path = originalPath;
        }
    }
}
